package lhb.test.SC.oauth2;

import java.security.Principal;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import lhb.test.SC.uum.model.User;

@SpringBootApplication
@RestController
public class Oauth2Application {
	
	@RequestMapping("/user")
    public User user(Principal pUser) {
		User user =new User();
		
		user.setName(pUser.getName());
        return user;
    }
	
	public static void main(String[] args) {
		SpringApplication.run(Oauth2Application.class, args);
	}
	
}
